package cn.iocoder.mall.resource.service.impl;

import cn.iocoder.common.framework.util.ObjectUtils;
import cn.iocoder.mall.resource.api.ShopTypeService;
import cn.iocoder.mall.resource.dataobject.ShopType;
import cn.iocoder.mall.resource.service.IShopTypeService;
import dto.ShopTypeDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/***
 *@author yinxucun
 *@date 2019-11-25 13:27 
 */
@Service
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.ShopTypeService.version}")
public class ShopTypeServiceRpcImpl implements ShopTypeService {

    @Autowired
    @Qualifier("shopTypeServiceImpl")
    IShopTypeService shopTypeService;


    @Override
    public ShopTypeDTO getOneById(String categoryId) {
        ShopType shopType=shopTypeService.getById(categoryId);
        if (shopType!=null){
        return ObjectUtils.copyProperties(shopType,ShopTypeDTO.class);
        }
        return new ShopTypeDTO();

    }
}
